#pragma once
#include "pch.h"

namespace fxcc
{

    struct WavFile
    {

#pragma pack(push, 1)

        struct WAVHeader {
            char chunkID[4];
            uint32_t chunkSize;
            char format[4];
            char subchunk1ID[4];
            uint32_t subchunk1Size;
            uint16_t audioFormat;
            uint16_t numChannels;
            uint32_t sampleRate;
            uint32_t byteRate;
            uint16_t blockAlign;
            uint16_t bitsPerSample;
            char subchunk2ID[4];
            uint32_t subchunk2Size;
        };
#pragma pack(pop)

        WAVHeader m_Header;

        //uint8_t* m_Data = 0;
        std::vector<uint8_t> m_Data;

        std::string m_Path;

        bool m_Available{ 0 };

        WavFile(const std::string& _p);

        bool Init();

        uint32_t DataSize();

        uint8_t* Data();

        uint32_t SampleRate();

        uint16_t GetAlFormat();

        ~WavFile();
    };

}
